package com.skyit.bigevent.anno;

import com.skyit.bigevent.validation.StateValidation;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.*;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

@Target({FIELD})//元注解
@Retention(RUNTIME)//元注解
@Documented//元注解
@Constraint(validatedBy = {StateValidation.class})//指定校验器
public @interface State {
    String message() default "状态值只能是已发布或草稿";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

}
